<template>
  <Son :titles="titles" @currentIndex="changePage" :changePage="changePage"></Son>
  <br />
  {{ pageConetnt }}
</template>

<script>
import Son from './son.vue'
export default {
  name: 'HelloWorld',
  components: { Son },
  data() {
    return {
      titles: ['衣服', '鞋子', '裤子'],
      contents: ['衣服页面', '鞋子页面', '裤子页面'],
      pageIndex: 0,
    }
  },
  computed: {
    pageConetnt() {
      return this.contents[this.pageIndex]
    },
  },
  methods: {
    changePage(pageIndex) {
      this.pageIndex = pageIndex
    },
  },
}
</script>
<style scoped></style>
